def connect(date1,volumn1,price1,rise1,time1):
    db=MySQLdb.connect("localhost","root","998426","stock")
    cursor=db.cursor()
    sql="insert into stock_CB(dates,volumn,price,rise,times) values('%s','%s',%f,'%s','%s')" % (date1.encode("utf-8"),volumn1.encode("utf-8"),price1,rise1.encode("utf-8"),time1.encode("utf-8"))
    try:
        cursor.execute(sql)
        db.commit()
    except:
        db.rollback()
    db.close()